<template>
	<!--招采管理-物资招采列表-应标结果弹窗-->
	<j-modal :title="title" :width="width" :visible="visible" switchFullscreen @ok="handleOk"
		:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @cancel="handleCancel" okText="预览会签表" cancelText="关闭">
		<wt-public-form @ok2="ok3" v-if="id !== ''" ref="realForm" @updateBiddingSuccess="updateBiddingSuccess"
			@ok="submitCallback" :disabled="disableSubmit" :id="id" :pageType="pageType"></wt-public-form>

	</j-modal>
</template>

<script>
	import WtPublicForm from './WtPublicBiddingRecruitResultForm'

	export default {
		name: 'WtPublicBiddingxiugaiModal',
		components: {
			WtPublicForm
		},
		props: {
			
		},
		data() {
			return {
				showKey: "wt-public-form",
				title: '应标结果',
				id: '',
				width: 1100,
				visible: false,
				disableSubmit: false,
				pageType:'',
			}
		},
		methods: {
			add() {
				this.visible = true
				this.$nextTick(() => {
					this.$refs.realForm.add();
				})
			},
			edit(record,type) {
				this.visible = true
				var _this = this
				_this.id = record.id;
				this.pageType = type;
				this.$nextTick(() => {
					// console.log('编辑2：', record.id)
					//   this.$refs.realForm.edit(record);
				})
			},
			close() {
				this.$emit('close');
				this.visible = false;
			},
			handleOk(record) {
				// console.log('确认', this.id)
				this.$emit('list', this.id)
				this.$refs.realForm.updateBidding(this.id);
			},
			updateBiddingSuccess() {
				this.$emit('updateBiddingOk', this.id);
			},
			submitCallback() {
				this.$emit('ok');
				this.visible = false;
			},
			ok3() {
				this.$emit('ok4');
				this.close()
				this.visible = false;
			},
			handleCancel() {
				this.close()
			}
		}
	}
</script>